<template>
    <div>
        <div class="container">
            <header>
                <div class="header-container">
                    <div class="logo"></div>
                    <div class="search">
                        <router-link to="/search">
                            <input type="text" placeholder="搜索" />
                            <i class="search-icon"></i>
                            <i class="voice-icon"></i>
                        </router-link>
                    </div>
                    <div class="right">
                        <i class="sign-in"></i>
                        <i class="add"></i>
                    </div>
                </div>
            </header>
        </div>
    </div>
</template>

<style>
.container {
    width: 95%;
    margin: 0 auto;

    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 40px;
        background-color: #f9f8fd;
        display: flex;
        justify-content: space-between;
        align-items: center;


        .header-container {
            width: 95%;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;

            .logo {
                width: 100px;
                height: 100px;
            }

            .search {
                width: 80%;
                position: relative;
                height: 40px;
                display: flex;
                align-items: center;

                a {
                    width: 100%;
                    position: relative;
                    height: 40px;
                    display: flex;
                    align-items: center;

                    input {
                        width: 100%;
                        height: 30px;
                        border: 1px solid #ccc;
                        background-color: #fff;
                        border-radius: 50px;
                        padding-left: 40px;
                        font-size: 14px;
                        outline: none;
                    }

                    .search-icon {
                        position: absolute;
                        top: 50%;
                        left: 10px;
                        transform: translateY(-50%);
                        display: block;
                        width: 20px;
                        height: 20px;
                        background: url(../assets/img/search.png) no-repeat center / contain;
                    }

                    .voice-icon {
                        position: absolute;
                        top: 50%;
                        right: 10px;
                        transform: translateY(-50%);
                        display: block;
                        width: 20px;
                        height: 20px;
                        background-image: url(../assets/img/voice.png);
                        background-size: cover;
                    }
                }
            }

            .right {
                width: 20%;
                display: flex;
                justify-content: space-around;
                align-items: center;

                .sign-in,
                .add {
                    display: inline-block;
                    width: 20px;
                    height: 20px;
                    background-size: cover;
                    cursor: pointer;
                    /* 增加指针样式 */
                }

                .sign-in {
                    background-image: url(../assets/img/sign_in.png);
                }

                .add {
                    background-image: url(../assets/img/add.png);
                }
            }
        }
    }


}
</style>